package com.rabbitmq.receivers;

import com.rabbitmq.config.HeadersConfig;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author 王霄
 * @date 2022/1/8 16:46
 */
@Component
public class HeadersReceiver {

    @RabbitListener(queues = HeadersConfig.QUEUE1)
    public void consume1(String message) {
        System.out.println("Headers模式接收队列1消息 : " + message);
    }

    @RabbitListener(queues = HeadersConfig.QUEUE2)
    public void consume2(String message) {
        System.out.println("Headers模式接收队列2消息 : " + message);
    }

    @RabbitListener(queues = HeadersConfig.QUEUE3)
    public void consume3(String message) {
        System.out.println("Headers模式接收队列3消息 : " + message);
    }

    @RabbitListener(queues = HeadersConfig.QUEUE4)
    public void consume4(String message) {
        System.out.println("Headers模式接收队列4消息 : " + message);
    }

    @RabbitListener(queues = HeadersConfig.QUEUE5)
    public void consume5(String message) {
        System.out.println("Headers模式接收队列5消息 : " + message);
    }

    @RabbitListener(queues = HeadersConfig.QUEUE6)
    public void consume6(String message) {
        System.out.println("Headers模式接收队列6消息 : " + message);
    }
}
